<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密码</title>

<%@ include file="/common/include.jsp" %>
<link href="<%=request.getContextPath() %>/fare/css/base.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #3366cc}
-->
</style>
<!-- 圆角文本框 -->
<link href="<%=request.getContextPath() %>/fare/css/htc/htc.css" rel="stylesheet" type="text/css" />
</head>
<body>​
<table cellSpacing=1 cellPadding=3 width="100%" border=0 class="tabg" align="center">
  <tr class="tr1">
    <td colspan="2">修改密码 </td>
    </tr>
  <tr class="tab">
    <td class="td1" width="50%">用户名：</td>
    <td>${user.userName }</td>
  </tr>
  
  <tr class="tab">
    <td class="td1">员工号：</td>
    <td>${user.ids }</td>
  </tr>
   
   <!-- 
  <tr class="tab" >
  <td class="td1">​旧密码：​</td>
  <td><input type="password" id="old_password" value="">​​</td>
  </tr>
   -->​
  <tr class="tab">
  <td class="td1">​新密码：​</td>
  <td><input id="txtNewPass"  type="password"  required="true" > &nbsp;<font color="red" >*</font></td>
  </tr>
  <tr class="tab">
  <td class="td1">确认​新密码：​</td>
  <td><input type="password" id="txtRePass" >​ &nbsp;<font color="red" >*</font></td>
  </tr>
  <tr class="tab">
    <td height="26" align=center colspan="2">
      <input id="Submit" type="button"  value="保存" style="width:80px">
      <input id="reset" type="button"  value="返回" style="width:80px">
       <!-- 
      <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" >确定</a>
	   <a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
     --->
      </td>
  </tr>
</table>
    
</body>
</html>

<script type="text/javascript">

function showm(sid){
var which = document.getElementById("lite" + sid);
var imgmenu = document.getElementById("ling" + sid);
	if (which.style.display == "none"){
		document.getElementById("lite" + sid).style.display="";
	}
	else{
		document.getElementById("lite" + sid).style.display="none";
		}

}

function updatePassWord(){
	 var password = $('#txtNewPass').val();
	 var txtRePass = $('#txtRePass').val();
	 if(password!=txtRePass){
		/// $.ligerDialog.error('两次输入密码不正确!');
		 
		 $.messager.alert('错误信息','<div style="padding-top:15px;padding-left:5px"><b>两次输入密码不正确</b></div>','error');
		 return ;
	 }
	 if(password.length<8){
		 ////$.ligerDialog.error('密码长度在8位或以上!');
		 $.messager.alert('错误信息','<div style="padding-top:15px;padding-left:5px"><b>密码长度在8位或以上</b></div>','error');
		 return;
	 }
	 var url="<%=request.getContextPath()%>/loginPackage/loginAction!updatePassWord.action";
	 $.post(
			url,
			{'Password':password},
			function(data){
				eval('data='+data);
	        	var state = data.state;
	        	var retMsg = data.resultMsg;
	        	if(state==true){
	        		///$.ligerDialog.success('修改成功!');
	        		$.messager.alert('成功信息','<div style="padding-top:15px;padding-left:5px"><b>修改成功!</b></div>','info');
	        	}else{
	        		$.messager.alert('失败信息','<div style="padding-top:15px;padding-left:5px"><b>修改失败!</b></div>','info');
	        		///$.ligerDialog.error('修改失败!');
	        	}
	        	////$.messager.alert('提示信息','<div style="padding-top:15px;padding-left:5px"><b>'+retMsg+'</b></div>','info');
			}
	 );
}
	 function reloadPwd(){
	 	$("#txtNewPass").val("");
	 	$("#txtRePass").val("");
	 }
	 
	$(function() {
		 $('#Submit').click(function() {
	    	 updatePassWord();
	     });
		 $('#reset').click(function(){reloadPwd();});
	});
	</script>
	